Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ThermalEnergyDemand #918

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

danielfeismann
Copy link
Member

resolves #917

I started here, but more needs to be done. Feel free to take over :)

@danielfeismann danielfeismann self-assigned this Aug 21, 2024
@danielfeismann danielfeismann added enhancement New feature or request HiWiStart Good for New HiWis labels Aug 21, 2024
Copy link
Member Author

@danielfeismann danielfeismann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this further, @marvinheintze! Also a good idea to add the cases for negative demands. I thought a bit on this and I guess it will be easier to go just with positive demands as we at the moment doesn't have any specific use case that requires negative demands. So please remove them again, I'm sorry for the confusion that may arised.

Comment on lines +604 to +610
if (
math.abs(possible.toKilowattHours) < math.abs(
required.toKilowattHours
) && math.signum(possible.toKilowattHours) <= math.signum(
required.toKilowattHours
)
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible would be -2 and required 1 this would not throw an exception, or am I wrong?
Lets go with just positive values (at least for now). So it would be great to check first if req or pos is negative plus if possible is smaller than required. In any case we should throw an an InvalidParameterException with a suitable message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HiWiStart Good for New HiWis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor ThermalGridDemand
2 participants